<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function fn1() {
            let num = 0;
            function fn2() {
                ++num;
                console.log('我被调用第' + num + '次');
            }
            return fn2();
        }
        let fn = fn1();
        fn();
        fn();
        fn();
        fn();
    </script>
</body>

</html>